<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>确认删除产品</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            display: flex;
            flex-direction: column;
            align-items: center; /* 垂直居中 */
        }
        h1 {
            color: #333;
            margin: 20px 0;
        }
        .flash {
            margin: 10px 0;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            width: 80%;
            text-align: center;
        }
        .flash.error {
            background-color: #ffe6e6;
            border-color: #ffcccc;
            color: #b30000;
        }
        .flash.success {
            background-color: #e6ffe6;
            border-color: #ccffcc;
            color: #006600;
        }
        form {
            max-width: 400px;
            margin: 20px auto;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 5px;
            background-color: #f9f9f9;
            width: 80%;
            display: flex;
            flex-direction: column;
            align-items: center; /* 水平居中 */
        }
        label {
            display: block;
            margin: 10px 0;
            width: 100%;
        }
        input[type="text"],
        input[type="number"],
        input[type="file"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        button {
            padding: 10px 20px;
            background-color: #DC3545; /* 修改为红色 */
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin: 10px 0; /* 添加上下外边距 */
        }
        button:hover {
            background-color: #A71D2A; /* 修改为更深的红色 */
        }
        a {
            display: block;
            margin: 10px 0;
            text-decoration: none;
            color: #007BFF;
            font-size: 16px;
            text-align: center;
            width: 80%;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <h1>确认删除产品</h1>
    <p>警告：如果删除产品 <strong>{{ product.name }}</strong>，将同时删除其销售记录和采购记录。</p>
    <form action="{{ url_for('delete_product', product_id=product.id) }}" method="POST">
        <input type="hidden" name="product_id" value="{{ product.id }}">
        <button type="submit">确认删除</button>
    </form>
    <a href="{{ url_for('list_products') }}">取消</a>
</body>
</html>